# $Id: PKGBUILD 89841 2013-05-03 07:54:16Z alucryd $
# Maintainer: Maxime Gauduin <alucryd at gmail dot com>
# Contributor: unikum <unikum dot pm at gmail.com>
# Contributor: speed145a <jonathan at tagchapter dot com>

pkgname=firewalld
pkgver=0.3.2
pkgrel=1
pkgdesc="A firewall daemon with D-BUS interface providing a dynamic firewall"
arch=('any')
url="http://fedorahosted.org/firewalld"
license=('GPL2')
depends=('ebtables' 'gtk3' 'hicolor-icon-theme' 'iptables' 'libnotify' 'networkmanager' 'python2-slip')
makedepends=('intltool')
backup=('etc/conf.d/firewalld' 'etc/firewalld/firewalld.conf')
install=${pkgname}.install
source=("http://fedorahosted.org/released/${pkgname}/${pkgname}-${pkgver}.tar.bz2" 'paths.patch')
sha256sums=('aa52ea143d6df474f81f599f148d9db4c8f54fd78c5878ab3ae9b461584bd68e'
            'ee826f06ec8d8fc964d63005850dbc8da9058a3d49b5ccd5df21c7dd52b3de7f')

prepare() {
  cd "${srcdir}"/${pkgname}-${pkgver}

  patch -Np1 -i "${srcdir}"/paths.patch
  sed -i 's|^#!.*python$|#!/usr/bin/python2|
          s|^#!.*python -Es$|#!/usr/bin/python2|' $(grep -rl '^#!.*python')
  sed -i 's|python|python2|g' fix_python_shebang.sh
}

build() {
  cd "${srcdir}"/${pkgname}-${pkgver}

  export  PYTHON=python2
  ./configure --prefix=/usr --sysconfdir=/etc --disable-schemas-compile
  make
}

package() {
  cd "${srcdir}"/${pkgname}-${pkgver}

  make DESTDIR="${pkgdir}" install
}

# vim: ts=2 sw=2 et:
